<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>首页</title>
    <!-- 引入 layui.css -->
    <link href="//unpkg.com/layui@2.8.18/dist/css/layui.css" rel="stylesheet">
    <!-- 引入 layui.js -->
    <script src="//unpkg.com/layui@2.8.18/dist/layui.js"></script>
</head>

<body>
    <div style="display: flex; justify-content: center; align-items: center; flex-direction: column;">
        <h1>视频列表</h1>
        <table class="layui-table">
            <colgroup>
                <col width="400">
                <col width="200">
                <col>
            </colgroup>
            <thead>
                <tr>
                    <th>视频名字</th>
                    <th>上传时间</th>
                    <th>观看</th>
                </tr>
            </thead>
            <tbody>
                {% for movie in movie_list %}
                <tr>
                    <td>{{movie.name}}</td>
                    <td>{{movie.create_at.strftime('%Y-%m-%d %H:%M:%S')}}</td>
                    <td>
                        <a style="color: white;" href="/video_view?video_id={{movie.id}}">
                            <button type="button" class="layui-btn">
                                点击观看
                            </button>
                        </a>
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
        <a style="color: white;" href="/upload_movie">
            <button type="button" class="layui-btn">
                上传视频
            </button>
        </a>
    </div>
</body>

</html>